
to import csv files to remote postgres server via STDIN

psql -h localhost -d code_list_library -U clluser -c "copy public.clinicalcode_staging_icd10_codes_and_titles_and_metadata(code, alt_code, usage, usage_uk, description, modifier_4,        modifier_5, qualifiers, gender_mask, min_age, max_age, tree_description,        chapter_number, chapter_code, chapter_description, category_1_code,        category_1_description, category_2_code, category_2_description,        category_3_code, category_3_description, icd_version, import_date,        created_date, effective_from, effective_to, avail_from_dt) 	   FROM STDIN DELIMITER ',' csv header encoding 'windows-1251';" 	   < C:\Users\<user>\Codes\ICD10_CODES_AND_TITLES_AND_METADATA_201712121111.csv	   	   


psql -h localhost -d code_list_library -U clluser -c "copy public.clinicalcode_staging_opcs4_codes_and_titles(code_with_decimal, code_without_decimal, title, opcs_version,        import_date, created_date, effective_from, effective_to, avail_from_dt) 	   FROM STDIN DELIMITER ',' csv header encoding 'windows-1251';" 	   < C:\Users\<user>\Codes\OPCS4_CODES_AND_TITLES_201712121110.csv	   	   



psql -h localhost -d code_list_library -U clluser -c "copy public.clinicalcode_staging_read_cd_cv2_scd(read_code, pref_term_30, pref_term_60, pref_term_198, icd9_code, icd9_code_def, icd9_cm_code, icd9_cm_code_def, opcs_4_2_code,        opcs_4_2_code_def, speciality_flag, status_flag, language_code,        source_file_name, in_source_data, import_date, created_date,        is_latest, effective_from, effective_to, avail_from_dt) 	   FROM STDIN DELIMITER ',' csv header encoding 'windows-1251';" 	   < C:\Users\<user>\Codes\READ_CD_CV2_SCD_201712121108.csv	   	   
	   

	   
psql -h localhost -d code_list_library -U clluser -c "copy public.clinicalcode_staging_read_cd_cv3_terms_scd(term_id, term_status, term_30, term_60, term_198, in_source_data,        import_date, created_date, is_latest, effective_from, effective_to,    avail_from_dt)	   FROM STDIN DELIMITER ',' csv header encoding 'windows-1251';" 	   < C:\Users\<user>\Codes\READ_CD_CV3_TERMS_SCD_201712121109.csv	   	   
	   